﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="NoteWeb.Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
        <link href="../css/home.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="../css/nav.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" EmptyDataText="没有可显示的数据记录。">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                    SortExpression="ID" />
                <asp:BoundField DataField="Lab" HeaderText="Lab" SortExpression="Lab" />
                <asp:BoundField DataField="Vis" HeaderText="Vis" SortExpression="Vis" />
                <asp:BoundField DataField="RootID" HeaderText="RootID" 
                    SortExpression="RootID" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DBCon %>" 
            DeleteCommand="DELETE FROM [wp_NLab] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [wp_NLab] ([ID], [Lab], [Vis], [RootID]) VALUES (@ID, @Lab, @Vis, @RootID)" 
            ProviderName="<%$ ConnectionStrings:DBCon.ProviderName %>" 
            SelectCommand="SELECT [ID], [Lab], [Vis], [RootID] FROM [wp_NLab]" 
            UpdateCommand="UPDATE [wp_NLab] SET [Lab] = @Lab, [Vis] = @Vis, [RootID] = @RootID WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:Parameter Name="Lab" Type="String" />
                <asp:Parameter Name="Vis" Type="Int32" />
                <asp:Parameter Name="RootID" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Lab" Type="String" />
                <asp:Parameter Name="Vis" Type="Int32" />
                <asp:Parameter Name="RootID" Type="Int32" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
        <br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    
    </div>
    </form>
</body>
</html>
